function b() {
    console.log(a);

    var a = 10;

    function a() {};

    a = 100;

    console.log(a);
    
}

b();


var num = 10;
var obj = {
    num: 8,
    inner: {
        num: 6,
        print: function () {
            console.log(num, this.num);
        }
    }
};
num = 888;

obj.inner.print();  // 888 6

var fn = obj.inner.print;
fn();  // 888 888 

(obj.inner.print)();  // 888 6

(obj.inner.print = obj.inner.print)();  // 888 888 